<?php
/*
 * @ https://EasyToYou.eu - IonCube v11 Decoder Online
 * @ PHP 7.2 & 7.3
 * @ Decoder version: 1.1.6
 * @ Release: 10/08/2022
 */

// Decoded file for php version 71.
namespace app\admin\controller;

require_once "keygen.php";
abstract class Brcv
{
    protected $request;
    protected $app;
    protected $batchValidate = false;
    protected $middleware = [];
    public $_app;
    public $_controller;
    public $_action;
    public $_method = "GET";
    public $_param = [];
    public $_input = [];
    public $_header = [];
    public $_host;
    public $_ip;
    public $_is_weiqin = false;
    public function __construct()
    {
    }
    public function shareChangeDatasssss($action)
    {
        $arr = ["clearCache", "noLookCount", "getW7TmpV2", "getSaasAuth", "isWe7", "getConfig", "login", "adminNodeInfo"];
        if(!empty($action) && in_array($action, $arr)) {
            return false;
        }
        return true;
    }
    public function isAuth()
    {
    }
    protected function errorMsg($msg = "", $code = 400)
    {
        $msg = \think\facade\Lang::get($msg);
        $this->results($msg, $code);
    }
    protected function results($msg, $code, array $header = [])
    {
        $result = ["error" => $msg, "code" => $code];
        $response = \think\Response::create($result, "json", 200)->header($header);
        throw new \think\exception\HttpResponseException($response);
    }
    protected function initialize()
    {
    }
    public function success($data, $code = 200)
    {
        $result["data"] = $data;
        $result["code"] = $code;
        $result["sign"] = NULL;
        $result["return_code"] = "SUCCESS";
        $result["return_msg"] = "OK";
        if(!empty($this->_token)) {
            $result["sign"] = createSimpleSign($this->_token, is_string($data) ? $data : json_encode($data));
        }
        return $this->response($result, "json", $code);
    }
    public function error($msg, $code = 400)
    {
        $result["error"] = \think\facade\Lang::get($msg);
        $result["code"] = $code;
        return $this->response($result, "json", 200);
    }
    protected function response($data, $type = "json", $code = 200)
    {
        return \think\Response::create($data, $type)->code($code);
    }
    protected function validate(array $data, $validate, array $message = [], $batch = false)
    {
        if(is_array($validate)) {
            $v = new \think\Validate();
            $v->rule($validate);
        } else {
            if(strpos($validate, ".")) {
                list($validate, $scene) = explode(".", $validate);
            }
            $class = false !== strpos($validate, "\\") ? $validate : $this->app->parseClass("validate", $validate);
            $v = new $class();
            if(!empty($scene)) {
                $v->scene($scene);
            }
        }
        $v->message($message);
        if($batch || $this->batchValidate) {
            $v->batch(true);
        }
        return $v->failException(true)->check($data);
    }
    public function getCityByLongLat()
    {
    }
    public function getCityByLongLatArr()
    {
    }
}

?>